package com.zbs.framework.dao.permission.service.model;

import com.zbs.framework.dao.permission.entity.Permission;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * 权限节点
 */
@Getter
@Setter
@NoArgsConstructor
public class ServicePermission {
    /**
     * 服务名
     */
    private String serviceName;
    /**
     * 权限
     */
    private List<PermissionNode> permissions;

    public void addPermission(Permission permission){
        if (permissions == null) permissions = new ArrayList<>();
        permissions.add(new PermissionNode(permission));
    }
}
